﻿@using Microsoft.AspNetCore.Http
@inject IHttpContextAccessor HttpContextAccessor
@using car.Models
@model Order
@{
    Layout = "_Layout";
}
<section role="main" class="content-body">

    <!-- start: page -->

        <div class="col-md-6">

            <section class="panel">

                <header class="panel-heading">
                    <div class="panel-actions">
                        <a href="#" class="fa fa-caret-down"></a>
                        <a href="#" class="fa fa-times"></a>
                    </div>
                    <h2 class="panel-title"></h2>
                    <h2>
                        统计分析图
                        <select class="form-control" id="salesSelector" style="display: none;">
                            <option value="JSOFT Admin" selected="">旅行趋势</option>
                            <!--<option value="JSOFT Drupal">用电量-->

                        </select>

                    </h2>
                </header>

                <div class="panel-body">
                    <div class="chart-data-selector ready" id="salesSelectorWrapper">
                        @using (var dbContext = new carContext())
                        {

                            int Monthwaterconsumptionhistory6 = 140;
                            int Monthwaterconsumptionhistory5 = 109;
                            int Monthwaterconsumptionhistory4 = 342;
                            int Monthwaterconsumptionhistory3 = 223;
                            int Monthwaterconsumptionhistory2 = 523;
                            int Monthwaterconsumptionhistory1 = 52;


                            int Monthelectricconsumptionhistory6 = 193;
                            int Monthelectricconsumptionhistory5 = 342;
                            int Monthelectricconsumptionhistory4 = 234;
                            int Monthelectricconsumptionhistory3 = 87;
                            int Monthelectricconsumptionhistory2 = 178;
                            int Monthelectricconsumptionhistory1 = 217;

                            var time = DateTime.Now;

                            string[] Month = new string[6];

                            switch (time.Month - 1)
                            {
                                case 1:
                                    Month[5] = "Jan";
                                    Month[4] = "Dec";
                                    Month[3] = "Nov";
                                    Month[2] = "Oct";
                                    Month[1] = "Sep";
                                    Month[0] = "Aug";
                                    break;

                                case 2:

                                    Month[5] = "Feb";
                                    Month[4] = "Jan";
                                    Month[3] = "Dec";
                                    Month[2] = "Nov";
                                    Month[1] = "Oct";
                                    Month[0] = "Sep";

                                    break;
                                case 3:

                                    Month[5] = "Mar";
                                    Month[4] = "Feb";
                                    Month[3] = "Jan";
                                    Month[2] = "Dec";
                                    Month[1] = "Nov";
                                    Month[0] = "Oct";
                                    break;
                                case 4:

                                    Month[5] = "Apr";
                                    Month[4] = "Mar";
                                    Month[3] = "Feb";
                                    Month[2] = "Jan";
                                    Month[1] = "Dec";
                                    Month[0] = "Nov";
                                    break;
                                case 5:

                                    Month[5] = "May";
                                    Month[4] = "Apr";
                                    Month[3] = "Mar";
                                    Month[2] = "Feb";
                                    Month[1] = "Jan";
                                    Month[0] = "Dec";
                                    break;
                                case 6:

                                    Month[5] = "Jun";
                                    Month[4] = "May";
                                    Month[3] = "Apr";
                                    Month[2] = "Mar";
                                    Month[1] = "Feb";
                                    Month[0] = "Jan";
                                    break;
                                case 7:

                                    Month[5] = "Jul";
                                    Month[4] = "Jun";
                                    Month[3] = "May";
                                    Month[2] = "Apr";
                                    Month[1] = "Mar";
                                    Month[0] = "Feb";
                                    break;
                                case 8:

                                    Month[5] = "Aug";
                                    Month[4] = "Jul";
                                    Month[3] = "Jun";
                                    Month[2] = "May";
                                    Month[1] = "Apr";
                                    Month[0] = "Mar";
                                    break;
                                case 9:

                                    Month[5] = "Sep";
                                    Month[4] = "Aug";
                                    Month[3] = "Jul";
                                    Month[2] = "Jun";
                                    Month[1] = "May";
                                    Month[0] = "Apr";
                                    break;
                                case 10:

                                    Month[5] = "Oct";
                                    Month[4] = "Sep";
                                    Month[3] = "Aug";
                                    Month[2] = "Jul";
                                    Month[1] = "Jun";
                                    Month[0] = "May";
                                    break;
                                case 11:

                                    Month[5] = "Nov";
                                    Month[4] = "Oct";
                                    Month[3] = "Sep";
                                    Month[2] = "Aug";
                                    Month[1] = "Jul";
                                    Month[0] = "Jun";
                                    break;
                                case 12:

                                    Month[5] = "Dec";
                                    Month[4] = "Nov";
                                    Month[3] = "Oct";
                                    Month[2] = "Sep";
                                    Month[1] = "Aug";
                                    Month[0] = "Jul";
                                    break;
                            }
            <div id="salesSelectorItems" class="chart-data-selector-items mt-sm">

                <div class="chart chart-sm chart-active" data-sales-rel="JSOFT Admin" id="flotDashSales1" style="padding: 0px;">
                    <canvas class="flot-base" width="1340" height="460" style="direction: ltr; position: absolute; left: 0px; top: 0px; width: 1340px; height: 460px;"></canvas>
                    <div class="flot-text" style="position: absolute; top: 0px; left: 0px; bottom: 0px; right: 0px; font-size: smaller; color: rgb(84, 84, 84);">
                        <div class="flot-x-axis flot-x1-axis xAxis x1Axis" style="position: absolute; top: 0px; left: 0px; bottom: 0px; right: 0px; display: block;">
                            <div class="flot-tick-label tickLabel" style="position: absolute; max-width: 59px; top: 161px; left: 27px; text-align: center;">@Month[0]</div>
                            <div class="flot-tick-label tickLabel" style="position: absolute; max-width: 59px; top: 161px; left: 86px; text-align: center;">@Month[1]</div>
                            <div class="flot-tick-label tickLabel" style="position: absolute; max-width: 59px; top: 161px; left: 146px; text-align: center;">@Month[2]</div>
                            <div class="flot-tick-label tickLabel" style="position: absolute; max-width: 59px; top: 161px; left: 208px; text-align: center;">@Month[3]</div>
                            <div class="flot-tick-label tickLabel" style="position: absolute; max-width: 59px; top: 161px; left: 268px; text-align: center;">@Month[4]</div>
                            <div class="flot-tick-label tickLabel" style="position: absolute; max-width: 59px; top: 161px; left: 332px; text-align: center;">@Month[5]</div>

                        </div>
                        <div class="flot-y-axis flot-y1-axis yAxis y1Axis" style="position: absolute; top: 0px; left: 0px; bottom: 0px; right: 0px; display: block;">
                            <div class="flot-tick-label tickLabel" style="position: absolute; top: 135px; left: 13px; text-align: right;">0</div>
                            <div class="flot-tick-label tickLabel" style="position: absolute; top: 101px; left: 1px; text-align: right;">5</div>
                            <div class="flot-tick-label tickLabel" style="position: absolute; top: 68px; left: 1px; text-align: right;">10</div>
                            <div class="flot-tick-label tickLabel" style="position: absolute; top: 34px; left: 1px; text-align: right;">15</div>
                            <div class="flot-tick-label tickLabel" style="position: absolute; top: 0px; left: 1px; text-align: right;">20</div>
                        </div>
                    </div>
                    <canvas class="flot-overlay" width="512" height="350" style="direction: ltr; position: absolute; left: 0px; top: 0px; width: 512px; height: 350px;"></canvas>
                </div>
                <script>

                                var flotDashSales1Data = [{
                                    data: [
                                ["@Month[0]", @Monthwaterconsumptionhistory6],
                                ["@Month[1]", @Monthwaterconsumptionhistory5],
                                ["@Month[2]", @Monthwaterconsumptionhistory4],
                                ["@Month[3]", @Monthwaterconsumptionhistory3],
                                ["@Month[4]", @Monthwaterconsumptionhistory2],
                                ["@Month[5]", @Monthwaterconsumptionhistory1]
                                                                                                ],
                                color: "#0088cc"
                                                                                            }];

                                // See: assets/javascripts/dashboard/examples.dashboard.js for more settings.

                </script>

                <!-- Flot: Sales JSOFT Drupal -->
                <div class="chart chart-sm chart-hidden" data-sales-rel="JSOFT Drupal" id="flotDashSales2" style="padding: 0px;">
                    <canvas class="flot-base" width="678" height="230" style="direction: ltr; position: absolute; left: 0px; top: 0px; width: 543px; height: 184px;"></canvas>
                    <div class="flot-text" style="position: absolute; top: 0px; left: 0px; bottom: 0px; right: 0px; font-size: smaller; color: rgb(84, 84, 84);">
                        <div class="flot-x-axis flot-x1-axis xAxis x1Axis" style="position: absolute; top: 0px; left: 0px; bottom: 0px; right: 0px; display: block;">
                            <div class="flot-tick-label tickLabel" style="position: absolute; max-width: 89px; top: 161px; left: 96px; text-align: center;">@Month[0]</div>
                            <div class="flot-tick-label tickLabel" style="position: absolute; max-width: 89px; top: 161px; left: 166px; text-align: center;">@Month[1]</div>
                            <div class="flot-tick-label tickLabel" style="position: absolute; max-width: 89px; top: 161px; left: 238px; text-align: center;">@Month[2]</div>
                            <div class="flot-tick-label tickLabel" style="position: absolute; max-width: 89px; top: 161px; left: 308px; text-align: center;">@Month[3]</div>
                            <div class="flot-tick-label tickLabel" style="position: absolute; max-width: 89px; top: 161px; left: 382px; text-align: center;">@Month[4]</div>
                            <div class="flot-tick-label tickLabel" style="position: absolute; max-width: 89px; top: 161px; left: 454px; text-align: center;">@Month[5]</div>

                        </div>
                        <div class="flot-y-axis flot-y1-axis yAxis y1Axis" style="position: absolute; top: 0px; left: 0px; bottom: 0px; right: 0px; display: block;">
                            <div class="flot-tick-label tickLabel" style="position: absolute; top: 135px; left: 13px; text-align: right;">0</div>
                            <div class="flot-tick-label tickLabel" style="position: absolute; top: 113px; left: 1px; text-align: right;">100</div>
                            <div class="flot-tick-label tickLabel" style="position: absolute; top: 90px; left: 1px; text-align: right;">200</div>
                            <div class="flot-tick-label tickLabel" style="position: absolute; top: 68px; left: 1px; text-align: right;">300</div>
                            <div class="flot-tick-label tickLabel" style="position: absolute; top: 45px; left: 1px; text-align: right;">400</div>

                        </div>
                    </div>
                    <canvas class="flot-overlay" width="678" height="230" style="direction: ltr; position: absolute; left: 0px; top: 0px; width: 543px; height: 184px;"></canvas>
                </div>
                <script>

                                var flotDashSales2Data = [{
                                    data: [
                                        ["@Month[0]", @Monthelectricconsumptionhistory6],
                                ["@Month[1]", @Monthelectricconsumptionhistory5],
                                ["@Month[2]", @Monthelectricconsumptionhistory4],
                                ["@Month[3]", @Monthelectricconsumptionhistory3],
                                ["@Month[4]", @Monthelectricconsumptionhistory2],
                                ["@Month[5]", @Monthelectricconsumptionhistory1]

                                                                                                ],
                                color: "#2baab1"
                                                                                            }];

                                                                                            // See: assets/javascripts/dashboard/examples.dashboard.js for more settings.

                </script>

                <!-- Flot: Sales JSOFT Wordpress -->

            </div>}
                    </div>

                </div>
            </section>
        </div>

    
    <!-- end: page -->
</section>

<div id="flotTip" style="display: none; position: absolute; left: 931px; top: 550px;"></div><div class="jqvmap-label" style="display: none;"></div>